package com.bm.exception;

import com.bm.Result.CodeEnum;
import lombok.Data;

/**
 * @author 86134
 * @version 1.0
 * @description TODO
 * @date 2024/3/1 19:41
 */
@Data
public class BmException extends RuntimeException{
    private Integer Code;
    private String message;
    private CodeEnum resultCodeEnum;

    public BmException(CodeEnum resultCodeEnum){
        this.resultCodeEnum = resultCodeEnum;
        this.Code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMsg();
    }
    public BmException(int code ,String msg){
        this.Code = code;
        this.message = msg;
    }

}
